package com.wenmingliang.demo2.com.wenmingliang.demo1;

import org.junit.Test;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

/**
 * @author wenmingliang
 * @create 2023/3/23
 */
public class BigDecimalTest {

    BigDecimal decimal = new BigDecimal("234234");
    BigDecimal decimal2 = new BigDecimal(234234);

    @Test
    public void test01() {
        BigDecimal count = new BigDecimal("1");

        BigDecimal result1 = decimal.divide(count);
        BigDecimal result2 = decimal;
        System.out.println("*******************>>>>>>>>>>" + result1);
        System.out.println("*******************>>>>>>>>>>" + result2);
        System.out.println("*******************>>>>>>>>>>" + decimal2);
    }

    //3-排序
    @Test
    public void test02() {
//        sorted()——自然排序 默认为升序
        List<Integer> list = Arrays.asList(12, 43, 65, 34, 87, 0, -98, 7);
        list.stream().sorted().forEach(System.out::println);

    }
}
